import request from '@/utils/request'

export function getFlowRoleTypes() {
  return request({
    url: '/api/Flow/FlowProcess/GetFlowRoleTypes',
    method: 'get'
  })
}

export function getBusiness(params) {
  return request({
    url: '/api/Flow/FlowProcess/GetBusiness',
    method: 'get',
    params
  })
}

export function getBusinesses() {
  return request({
    url: '/api/Flow/FlowProcess/GetBusinesses',
    method: 'get'
  })
}

export function getStepTypes() {
  return request({
    url: '/api/Flow/FlowProcess/GetStepTypes',
    method: 'get'
  })
}

export function getFlowFieldStepTypes() {
  return request({
    url: '/api/Flow/FlowProcess/GetFlowFieldStepTypes',
    method: 'get'
  })
}

export function getPassTypes() {
  return request({
    url: '/api/Flow/FlowProcess/GetPassTypes',
    method: 'get'
  })
}

export function getOperatorChoices(businessId) {
  return request({
    url: '/api/Flow/FlowProcess/GetOperatorChoices',
    method: 'get',
    params: { businessId }
  })
}

export function getMultiOpPassType() {
  return request({
    url: '/api/Flow/FlowProcess/GetMultiOpPassType',
    method: 'get',
  })
}

export function getFlowStepPositions() {
  return request({
    url: '/api/Flow/FlowProcess/GetFlowStepPositions',
    method: 'get',
  })
}

export function getFlows() {
  return request({
    url: '/api/Flow/FlowProcess/GetFlows',
    method: 'get',
  })
}

export function getFlow(flowId) {
  return request({
    url: '/api/Flow/FlowProcess/GetFlow',
    method: 'get',
    params: {
      flowId
    }
  })
}

export function saveFlow(flow) {
  return request({
    url: '/api/Flow/FlowProcess/SaveFlow',
    method: 'post',
    data: flow
  })
}

export function getRoles() {
  return request({
    url: '/api/Flow/FlowProcess/GetRoles',
    method: 'get'
  })
}
export function getEmployees() {
  return request({
    url: '/api/Flow/FlowProcess/GetEmployees',
    method: 'get'
  })
}
export function getDepartments() {
  return request({
    url: '/api/Flow/FlowProcess/GetDepartments',
    method: 'get'
  })
}
export function saveFields(data) {
  return request({
    url: '/api/Flow/FlowProcess/SaveFormFields',
    method: 'post',
    data: data
  })
}